package com.wang.spring.bean.a_type;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanTypeAnnoConfiguration {


    @Bean
    public Child child() {
        return new Child();
    }

//    @Bean
//    public Toy ball() {
//        return new Ball("ball1");
//    }

    @Bean
    public ToyFactoryBean toyFactoryAAA() {
        ToyFactoryBean toyFactoryBean = new ToyFactoryBean();
        toyFactoryBean.setChild(child());
        return toyFactoryBean;
    }
}
